package mapper;


import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.log4j.Logger;
import org.beetl.sql.core.annotatoin.Sql;
import org.beetl.sql.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import entity.SysUser;


@Mapper 
@Repository
public interface SysUserRepository extends BaseMapper<SysUser>{

		public static Logger logger = Logger.getLogger(SysUserRepository.class);  
	
		public int getCount();

		@Sql(value=" select * from sysconsole.sys_user",returnType=SysUser.class)
		public List<SysUser> allSysUsers();
		
		@Sql(value=" select * from sysconsole.sys_user where seqid = ?",returnType=SysUser.class)
		public SysUser findById(long seqid);
		
		@Sql(value=" delete from sysconsole.sys_user where seqid = ?")
		public void deleteForId(long seqid);
		
		@Sql(value=" select password from sysconsole.sys_user where username = ?",returnType=String.class)
		public String findPassWordByName(String name);
		
		@Sql(value=" select * from sysconsole.sys_user where username = ?",returnType=SysUser.class)
		public SysUser findByUsername(String name);
		
	

}
